package com.example.zq;


import com.example.zq.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author : Zhang Qi
 * @date : 2019/11/25
 */
@FeignClient("provider")
public interface HelloService {
  @GetMapping("/hello")
  public String hello(@RequestParam("name") String name);
  @DeleteMapping("/user/{id}")
  public void deleteUserById(@PathVariable Integer id);
  @GetMapping("/user")
  public User getUserById(@RequestParam Integer id);
  @PostMapping("/user")
  public User addUser(@RequestBody User user);
  @PutMapping("/user")
  public void updateUserById(@RequestHeader String name, @RequestHeader Integer id);
}
